import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Administrator
 * Date: 2024-09-28
 * Time: 20:08
 */
public class Test {
    public static void main(String[] args) {
        MyArrayList<Integer> myArrayList = new MyArrayList<>();
        MyArrayList<String> myArrayList1 = new MyArrayList<>();
        myArrayList.add(10);
        myArrayList.add(20);
        myArrayList.add(30);
        myArrayList.add(40);
        myArrayList.add(50);
        myArrayList.disPlay();
        myArrayList1.add("ancd");
        myArrayList1.add("adef");
        myArrayList.disPlay();
        System.out.println("=================");

        myArrayList.add(1,15);
        myArrayList.disPlay();
        //myArrayList.add(-1,-5);
        myArrayList.disPlay();
        System.out.println("=================");

        myArrayList.contains(15);
        myArrayList.contains(88);
        System.out.println("=================");

        System.out.println("该数据存在,下标为:" + myArrayList.indexOf(15));
        myArrayList.indexOf(88);
        System.out.println("=================");

        System.out.println(myArrayList.get(0));
        System.out.println(myArrayList.get(1));
        //System.out.println(myArrayList.get(10));
        System.out.println("=================");

        myArrayList.set(1,13);
        myArrayList.set(2,23);
        //myArrayList.set(-1,999);
        myArrayList.disPlay();
        System.out.println("=================");

        myArrayList.size();
        System.out.println("=================");

        myArrayList.remove(13);
        myArrayList.remove(77);
        myArrayList.disPlay();
        myArrayList1.remove("ancd");
        myArrayList.disPlay();
        System.out.println("=================");

        myArrayList.clear();
        myArrayList.disPlay();
        myArrayList1.clear();
        myArrayList1.disPlay();
    }
}
